package com.mryan.ps_common.configure;

import com.mryan.ps_common.handle.PSAccessDeniedHandler;
import com.mryan.ps_common.handle.PSAuthExceptionEntryPoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @BelongsProject: ps_cloud
 * @BelongsPackage: com.mryan.ps_common.configure
 * @Author: Yan
 * @CreateTime: 2021-04-25 21:16
 * @Description:
 */
public class PSAuthExceptionConfigure {

	@Bean
	@ConditionalOnMissingBean(name = "accessDeniedHandler")
	public PSAccessDeniedHandler accessDeniedHandler() {
		return new PSAccessDeniedHandler();
	}

	@Bean
	@ConditionalOnMissingBean(name = "authenticationEntryPoint")
	public PSAuthExceptionEntryPoint authenticationEntryPoint() {
		return new PSAuthExceptionEntryPoint();
	}

}
